import Vue from 'vue'
// import './plugins/axios'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import '@/styles/index.scss' // global css

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

import axios from 'axios'

import echarts from 'echarts'

// axios.defaults.baseURL = 'http://47.106.171.84:8181/web/'
axios.defaults.baseURL = 'http://localhost:9898/web/'

axios.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'
axios.interceptors.request.use(config => {
  NProgress.start()
  config.headers.token = window.sessionStorage.getItem('token')
  return config
})
axios.interceptors.response.use(config => {
  NProgress.done()
  return config
})
Vue.prototype.$axios = axios
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
